﻿#region

using System.Data.Entity;
using CuongHanh.Models;

#endregion

namespace CuongHanh.DAL
{
    public class MasterDbContext : DbContext
    {
        public MasterDbContext()
                : base("db")
        {
        }

        public DbSet<User> Users { get; set; }

        public DbSet<Category> Categorys { get; set; }

        public DbSet<SubCategory> SubCategorys { get; set; }

        public DbSet<Product> Products { get; set; }

        public DbSet<ProductImage> ProductImages { get; set; }

        public DbSet<MyStyle> MyStyles { get; set; }

        public DbSet<StyleType> StyleTypes { get; set; }

        public DbSet<Material> Materials { get; set; }

        public DbSet<MyStone> MyStones { get; set; }

        public DbSet<StyleImage> StyleImages { get; set; }

        public DbSet<StyleMaterial> StyleMaterials { get; set; }

        public DbSet<StyleStone> StyleStones { get; set; }

        public DbSet<ParentMaterial> ParentMaterials { get; set; }

        public DbSet<PriceHistory> PriceHistories { get; set; }


        public DbSet<StaticPage> StaticPages { get; set; }
        public DbSet<ServiceFee> ShippingCosts { get; set; }
        public DbSet<TiGia> TiGias { get; set; }
        public DbSet<Customer> Customers { get; set; }


        public DbSet<OrderForGem> OrderForGems { get; set; }
        public DbSet<OrderDetailForGem> OrderDetailForGems { get; set; }

        protected override void OnModelCreating(DbModelBuilder modelBuilder)
        {
            modelBuilder.Entity<StaticPage>().Property(c => c.Id).HasDatabaseGeneratedOption(null);
            base.OnModelCreating(modelBuilder);
            //modelBuilder.Entity<Category>()
            //            .ToTable("tbl_Category");
            //modelBuilder.Entity<SubCategory>()
            //              .ToTable("tbl_SubCategory");
            //modelBuilder.Entity<Product>()
            //              .ToTable("tbl_Product");
            //modelBuilder.Entity<ProductImage>()
            //              .ToTable("tbl_ProductImage");
            //modelBuilder.Entity<Banner>()
            //              .ToTable("tbl_Banner");
        }
    }
}
